package com.beidouapp.mvc;

import com.beidouapp.domain.pojo.Dict;
import com.beidouapp.domain.pojo.PrjProgress;
import com.beidouapp.domain.pojo.Project;
import com.beidouapp.domain.vo.ProjectVo;
import com.beidouapp.security.model.ReturnDataInfo;
import com.beidouapp.service.*;
import com.beidouapp.translator.TranslatorManager;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *  项目管理{论坛同步用户/咨询客户}
 */
@Controller
@RequestMapping(value = "/dict")
public class DictController {

    private Logger logger = LoggerFactory.getLogger(DictController.class);

    @Autowired
    private DictService dictService;

    @RequestMapping(value = "/dict/{codeType}", method = RequestMethod.GET)
    public
    @ResponseBody
    ReturnDataInfo<Dict> dictList(@PathVariable String codeType){
        try{
            List <Dict> dicts=dictService.getChildDict(codeType,null);
            return ReturnDataInfo.createSuccessfulExecuteResults(dicts);
        } catch (Exception ex) {
            logger.error("获取字典失败", ex);
            return ReturnDataInfo.createFailedExecuteResult(ex.getMessage());
        }
    }





}
